<?php
class kaj extends FR_Module{
    
    public function calculate(){
        
        $c = new model_calculator();
        $c->add(100);
        $this->set("amount", $c->get());
        $this->renderJSON();        
        
    }
    
    public function RestTest(){
        $r = RRest::call("POST", "http://sdca2b9c/SkeletonPortal/rest/test", array("tuser"=>"T180469"));
        if (is_array($r->data)){
            print_r($r->data);
        }
        die();
    }
    
    public function allan(){
        $this->set("kajdata", array("kaj", "bjarne", "søren"));
        $this->renderPHTML("kaj");
    }
    
    public function bjarne(){
        $form1 = new RForm("form1", FR_PATH."/main/kaj/bjarneCalc");
        $form1->addTextField("navn");
        $form1->addTextField("alder");
        $this->set("form1", $form1);
        $this->renderPHTML("formTest");
        
    }
    
    public function bjarneCalc(){
        $model_calc = new model_bjarneCalculator($_POST);
        $this->setFromArray($model_calc->getResult());
        $this->renderJSON();
    }
    
}